<div class="admin_left actions">
    <h3 style="font-size:20px;">Manage more</h3>
	<ul>
	        <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Items'), array('action' => 'index'),array('class' => 'consistentButton')); ?> </li>
           </ul>
</div>


<?php if ($current_customer['group_id'] == 1): ?>
        <div class="admin_right items form">

        <div id=breadcrumbAdmin>
            <?php $this->Html->addCrumb('Edit item', '/Items/edit', array('style'=> ('text-decoration:underline;  color:#EB1E70;'))); ?>
            <?php echo $this->Html->getCrumbs(' > ', array( 'text' => 'Items', 'url' => array('controller' => 'items', 'action' => 'index'), 'escape' => false)); ?>
        </div>

            <?php echo $this->Form->create('Item',array('type'=>'file')); ?>
                    <fieldset>
                            <legend><?php echo __('Edit Item'); ?></legend>

                            <div id=itemEdit1>
                            <?php
                                    echo $this->Form->input('id');
                                    echo $this->Form->input('name');
                                    $consignment = array('Normal' => 'normal', 'Consignment' => 'Consignment');
                                    echo $this->Form->input('is_consignment');
                                    echo $this->Form->input('brand_id');
                                    echo $this->Form->input('color_id');
                                    echo $this->Form->input('condition_id');
                                    echo $this->Form->input('size_id');
                                    echo $this->Form->input('category_id');
                                    echo $this->Form->input('item_status_id');
                                    echo $this->Form->input('description');
                            ?>
                            </div>

                            <div id=itemEdit2>
                            <?php
                                    $onlines = array('Yes' => 'Yes', 'No' => 'No');
                                    echo $this->Form->input('online', array('options' => $onlines, 'default' => 'No'));
                                    $locations = array_combine( array('Backstorage', 'On Display'),array('Backstorage', 'On Display'));
                                    echo $this->Form->input('location', array('options' => $locations, 'default' => 'Backstorage'));
                                    echo $this->Form->input('original_price');
									echo $this->Form->input('current_price');
                                    $is_discounted = array('Yes' => 'Yes', 'No' => 'No');
                                    echo $this->Form->input('is_discounted', array('options' => $is_discounted, 'default' => 'No'));
                            ?>
                            </div>

                            <div id=itemEdit3>
                            <?php
                                    /*echo $this->Form->input('image_id', array(
                                        'label' => 'Cover Image',
                                    ));*/
                                    //echo $this->Form->input('image_id');
                                    //echo $this->Form->input('Image.0.name', array('label' => false, 'div' => false, 'type' => 'file'));
                                   // echo $this->Form->input('Image.1.name', array('label' => false, 'div' => false, 'type' => 'file'));
                                   // echo $this->Form->input('Image.2.name', array('label' => false, 'div' => false, 'type' => 'file'));
                                   // echo "<input type='button' id='more-fields' onclick='addFields();' value='Add more images' />";
                            ?>
                            </div>

                            <!--<?php// echo __('Images'); ?>-->

                        <?php if (!empty($item['Image'])): ?>
                            <table cellpadding = "0" cellspacing = "0">
                                <tr>
                                <?php $inRow = 0; ?>
                                <?php foreach ($item['Image'] as $image): ?>
                                    <td>
                                        <?php
                                            echo $this->Html->image('IMG_DIR'.'/'.$image['name'], array('width' => 175, 'height' => 175));
                                        ?>&nbsp;
                                        <br>
                                        <?php echo h($image['id']); ?>
                                        <br>
                                        <?php echo $this->Html->link(__('View'), array('controller' => 'images', 'action' => 'view', $image['id'])); ?>
                                        <?php echo $this->Html->link(__('Edit'), array('controller' => 'images', 'action' => 'edit', $image['id'])); ?>
                                        <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'images', 'action' => 'delete', $image['id']), null, __('Are you sure you want to delete # %s?', $image['id'])); ?>
                                    </td>
                                    <?php  $inRow++; if ($inRow % 3 == 0) {echo "</tr>";}
                                endforeach; ?>
                            </table>
                        <?php else: ?>
                                <?php //echo "No images available"; ?>
                        <?php endif; ?>
                    </fieldset>
            <?php echo $this->Form->end(__('Submit')); ?>
        </div>

<?php else: ?>
    <?php echo "You are not supposed to view this page"; ?>
<?php endif; ?>
